package com.example.module_home.Adapter;

import android.support.annotation.Nullable;

import com.blankj.utilcode.util.TimeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.module_home.DB.SeenCodeTable;
import com.example.module_home.R;

import java.text.DateFormat;
import java.util.Date;
import java.util.List;

/**
 * Created by 陈煜 on 2018/6/1.
 */

public class PersonalCodeAdapter extends BaseQuickAdapter<SeenCodeTable,BaseViewHolder> {

    public PersonalCodeAdapter(@Nullable List<SeenCodeTable> data) {
        super(R.layout.home_item_alloperation, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SeenCodeTable item) {
        helper.setText(R.id.tv_title,"【"+item.getTitle()+"】")
                .setText(R.id.tv_createdAt, TimeUtils.getChineseWeek(item.getSeenTime()))
                .setText(R.id.tv_kind,"{"+item.getKind()+"}")
                .setText(R.id.tv_user,item.getAuthor())
                .setVisible(R.id.tv_operate,false);
    }
}
